
const error_code = {
	101: 'username already exists'
}

const result = (res, data) => {
	const newData = {
		error: 0,
		data: data
	}
    res.json(newData)
}

const error = (res, errorCode) => {
	const newData = {
		error: errorCode,
		data: error_code[errorCode]
	}
    

    res.json(newData)
}

module.exports = {
    result,
    error,
};